import React, { useState } from 'react'

export default function StateDemo() {
  const [count, setCount] = useState(0)
  return (
    <div>
      <h3>计数:{count}</h3>
      <button onClick={() =>setCount(count=>count+1) }>加</button>
      <button onClick={() => setCount(count=>count-1)}>减</button>
    </div>
  )
}
